package com.jk.smartelderlycare.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jk.smartelderlycare.dto.SysCoupon;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;

public interface SysCouponMapper extends BaseMapper<SysCoupon> {
    /**
     * @description: 优惠劵后端分页查询
     * @param: [sysCoupon, page]
     * @return: com.baomidou.mybatisplus.core.metadata.IPage<com.jk.smartelderlycare.dto.SysCoupon>
     * @author hhk
     * @date: 2024/11/28 19:58
     */
    IPage<SysCoupon> findSysCouponPaginationList(@Param(value = "sysCoupon") SysCoupon sysCoupon, Page<SysCoupon> page);
    /**
     * @description: 新增中间表
     * @param: [couponMap]
     * @return: void
     * @author hhk
     * @date: 2024/11/28 20:26
     */
    void addSysCouponIdAndHomestayId(HashMap<String, Object> couponMap);
    /**
     * @description: 删除中间表
     * @param: [couponId]
     * @return: void
     * @author hhk
     * @date: 2024/11/28 20:31
     */
    @Delete("delete from sys_coupon_homestay where coupon_id = #{couponId}")
    void deleteSysCouponIdAndHomestayId(Long couponId);
    /**
     * @description: 根据id查询优惠劵信息
     * @param: [couponId]
     * @return: void
     * @author hhk
     * @date: 2024/11/28 20:38
     */
    SysCoupon findSysCouponById(Long couponId);
}